package org.john.javalib;

import java.text.DecimalFormat;

/**
 * Created by adsame on 18-4-24.
 */
public class NumberTest {
    private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("0.00");
    private static final int THOUSAND = 1000;

    public static void main(String args[]) {
        System.out.println(DECIMAL_FORMAT.format((double) 5566435781130l / (14300000 * 1000)));
        System.out.println(DECIMAL_FORMAT.format((double) 46 / 23));
        System.out.println(DECIMAL_FORMAT.format((double) 58 / 23));
        System.out.println(DECIMAL_FORMAT.format((double) -10 / 23));
        System.out.println(DECIMAL_FORMAT.format((double) 10 / 23));
        int count = 15906000;
        double totalTime = 1888504952162000.0 / THOUSAND;
        System.out.println(totalTime / count);
        System.out.println("run-time data: count:" + count +
                ", total time:" + totalTime / THOUSAND
                + "ms, average:" + DECIMAL_FORMAT.format(totalTime / count) + "ms");
    }
}
